<!DOCTYPE html>
    <html>
      <head>
        <title>PrlServerAPI web based GUI API Example application - Pizza cost calculator</title>
        <script language="javascript">
          function calculate() {
            var oFormObject = document.forms['myForm'];
            var cost = oFormObject.elements['cost'].value;
            var num = oFormObject.elements['num'].value;
            var xmlhttp = new XMLHttpRequest();
            xmlhttp.onreadstatechange=function() {
              if(xmlhttp.readyState==4 && xmlhttp.status==200){
                document.getElementById("dyn").innerHTML=xmlhttp.responseText;
              }
            };
            xmlhttp.open("GET", "/calc.html?cost="+cost+"&num="+num, true);
            xmlhttp.send();
          }
        </script>
      </head>
      <body>
        <div id="dyn">
          <form id="myForm">
            Total cost: <input name="cost" /><br />
            Number of eaters: <input name="num" /><br />
            <input type=button value="Calculate!" onclick="javascript:calculate();"/>
          </form>
        </div>
      </body>
    </html>
